<template>

  <div class="general-layout">
    <NavigationBar></NavigationBar>

    <div class="head">
    <button @click="goBack" class="searchBtn">返回上一个界面</button>
      <span style="
          margin-left: 5%;
          font-size: 2em;
          font-weight: bold;
          color: black;
          width: 40%;
        " class="demonstration">
        欢迎 {{ id }} 同学
      </span>
    </div>

    <div>
      <StuShowInfor :StuId="id" />
      <div style="width: 100%; height: 50px"></div>
    </div>

    <div>
      <StuDetails :StuId="id" />
    </div>
  </div>
</template>

<script setup>
import StuShowInfor from "./StuShow.vue";
import StuDetails from "./StuDetails.vue";
import NavigationBar from "../NavigationBar.vue";
import { useRoute, useRouter } from 'vue-router';


    const router = useRouter();

    const goBack = () => {
      router.back();
    };


const props = defineProps({
  id: String
});

</script>

<style scoped>
.head {
  display: flex;
  justify-content: space-between; /* 将内容分散对齐 */
  align-items: center; /* 垂直居中 */
}

.demonstration {
  font-size: 2em;
  font-weight: bold;
  color: black;
  margin-right: 5%; /* 调整右侧间距 */
}

.searchBtn {
  width: 30vw; /* 设置按钮宽度为40vw */
  display: inline-block;
  padding: 10px 20px;
  margin: 10px;
  color: #fff;
  background-color: #007bff;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}
</style>
